import request from '../../utils/request'
import axios from 'axios'



/*删除aliOss文件*/
export const deleteFile = (file1) => {
  const file=decodeURI(file1)
  return axios({
    url: '/api/deleteFile',
    method: 'post',
    params: {
      file
    },
  })
}

/*批量删除aliOss文件*/
export const deleteFiles = (files1) => {
  const files=decodeURI(files1)
  return axios({
    url: '/api/deleteFiles',
    method: 'post',
    params: {
      files
    },
  })
}


/*上传文件*/
export const uploadFile = (file) => {
  return axios({
    url: '/api/uploadFile',
    method: 'post',
    params: {
      file
    },
  })
}

/*列举文件*/
export const listFile = () => {
  return axios({
    url: '/api/listFile',
    method: 'post',
    params: {
    },
  })
}

/*下载文件*/
export const fileDownload = (file1) => {
  const file=decodeURI(file1)
  return axios({
    url: '/api/fileDownload',
    method: 'post',
    responseType: 'blob',
    params: {
      file
    },
  })
}
